home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C++ für Kids
/
C++ for kids.iso
/
Buch
/
Befund2.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
1998-12-18
|
1KB
|
46 lines
//---------------------------------------------------------------------------
#include <vcl\vcl.h>
#pragma hdrstop
#include "Befund2.h"
//---------------------------------------------------------------------------
#pragma resource "*.dfm"
const String DateiName = "Diagnose.txt";
TForm1 *Form1;
TStringList *Diagnose;
int Nr;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormCreate(TObject *Sender)
{
randomize ();
Diagnose = new TStringList;
Diagnose->LoadFromFile (DateiName);
ScrollBar1->Min = 0;
ScrollBar1->Max = Diagnose->Count - 1;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
Panel1->Caption = "";
Edit1->Text = "";
Edit1->SetFocus ();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button2Click(TObject *Sender)
{
Nr = random (Diagnose->Count);
Panel1->Caption = Diagnose->Strings[Nr];
}
//---------------------------------------------------------------------------
void __fastcall TForm1::ScrollBar1Change(TObject *Sender)
{
Panel1->Caption = Diagnose->Strings[ScrollBar1->Position];
}
//---------------------------------------------------------------------------